#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
	char arr[10] = { 0 };
	int i = 0;
	int countA = 0, countB = 0;
	while (1)
	{
		scanf("%c", &arr[i]);
		if (arr[i] != '0')
		{
			if (arr[i] == 'A')
				countA++;
			else if (arr[i] == 'B')
				countB++;
			i++;
		}
		else
		{
			break;
		}
	}
	if (countA > countB)
		printf("%c", 'A');
	else if (countB > countA)
		printf("%c", 'B');

	else
		printf("%c", 'E');


	return 0;
}